import request from "@/utils/request"

// 获取部门接口
export function getDepartments() {
    return request({
        url: '/company/department',
        method:'get'
    })
}

// 删除部门接口
export function  delDepartments(id) {
    return request({
        url: `/company/department/${id}`,
        method:'delete'
    })
}

// 新增部门接口
export function addDepartments(data) {
    return request({
        url: '/company/department',
        method: 'post',
        data
    })
}

// 获取编辑部门接口
export function  editDepartments(id) {
    return request({
        url: `/company/department/${id}`,
        method:'get'
    })
}

//提交编辑部门信息
export function  setDepartments(data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}